home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / 051-060 / amok52 / oberonced / req.mod < prev    next >
Text File  |  1993-11-04  |  21KB  |  467 lines

  1. (* Req.mod        ported to Oberon 1990 by Achim Siebert           *)
  2. (* reqlibrary.h © 1988/1989 reserved by Colin Fox and Bruce Dawson *)
  3.  
  4. MODULE Req;
  5.  
  6. IMPORT E: Exec,
  7.        I: Intuition,
  8.        G: Graphics,
  9.           Dos,
  10.           SYSTEM;
  11. CONST 
  12.       Name    * = "req.library";
  13.       Version * = 2;
  14.       
  15.       numPairs   * = 10;
  16.  
  17. TYPE GadgetBlockPtr * = POINTER TO GadgetBlock;
  18.  
  19. TYPE GadgetBlock * = STRUCT
  20.    gadget       *  : I.Gadget;
  21.    border       *  : I.Border;
  22.    pairs        *  : ARRAY numPairs OF INTEGER;
  23.    text    *  : I.IntuiText;
  24. END;
  25.  
  26. TYPE StringBlockPtr * = POINTER TO StringBlock;
  27.  
  28. TYPE StringBlock * = STRUCT
  29.    gadget       *  : I.Gadget;
  30.    info         *  : I.StringInfo;
  31.    border       *  : I.Border;
  32.    pairs        *  : ARRAY numPairs OF INTEGER;
  33. END;
  34.  
  35. TYPE PropBlockPtr * = POINTER TO PropBlock;
  36.  
  37. TYPE PropBlock * = STRUCT
  38.    gadget       *  : I.Gadget;
  39.    info         *  : I.PropInfo;
  40.    image        *  : I.Image;
  41. END;
  42.  
  43. TYPE ScrollBlockPtr * = POINTER TO ScrollBlock;
  44.  
  45. TYPE ScrollBlock * = STRUCT
  46.    arrowUpLt    *  : I.Gadget;
  47.    imageUpLt    *  : I.Image;
  48.    arrowDnRt    *  : I.Gadget;
  49.    imageDnRt    *  : I.Image;
  50.    prop         *  : PropBlock;
  51. END;
  52.  
  53. TYPE TwoImageGadgetPtr * = POINTER TO TwoImageGadget;
  54.  
  55. TYPE TwoImageGadget * = STRUCT
  56.    gadget       *  : I.Gadget;
  57.    image1       *  : I.Image;
  58.    image2       *  : I.Image;
  59. END;
  60.  
  61. CONST  
  62.        vertSlider  * = 16;   (* Default: Horizontal Slider *)
  63.  
  64.  
  65. (* This structure is used with the TextRequester function. *)
  66.  
  67. TYPE TRStructurePtr * = POINTER TO TRStructure;
  68.  
  69. TYPE TRStructure * = STRUCT
  70.    text         *  : E.ADDRESS; (*  This is the message text, including printf() style formatting if desired. *)
  71.    controls     *  : E.ADDRESS;   (*  This is the address of the parameter list, if printf() style formatting is used. *)
  72.    window       *  : I.WindowPtr; (*  This is an optional (zero if not used) pointer to a window on the screen you*)
  73.                                   (*  would like the requester to show up on. *)
  74.    middleText   *  : E.ADDRESS;   (*  If non-zero, this is the text for the gadget in the lower middle (returns 2). *)
  75.    positiveText *  : E.ADDRESS;   (*  If non-zero, this is the text for the gadget in the lower left hand corner (returns 1). *)
  76.    negativeText *  : E.ADDRESS;   (*  If non-zero, this is the text for the gadget in the lower right (returns 0). *)
  77.    title        *  : E.ADDRESS;   (*  This is the title for the window. *)
  78.    keyMask      *  : SET;         (*  This is the qualifier mask for the keyboard shortcuts. *)
  79.                                   (*  Use -1 to allow any qualifiers (or none). *)
  80.                                   (*  Zero means that no keyboard shortcuts are allowed. *)
  81.    textColor    *  : INTEGER;     (*  Color of the text.  Uses color 1 if no color specified. *)
  82.    detailColor  *  : INTEGER;     (*  Detail and block color, as in a NewWindow structure.  If *)
  83.    blockColor   *  : INTEGER;     (*  both are left zero, block pen will be set to 1. *)
  84.    versionNumber*  : INTEGER;     (*  Make SURE this is set to ReqVersion. *)
  85.    timeout      *  : INTEGER;     (*  the timeout value in seconds  *)
  86.    abortMask    *  : LONGINT;     (*  If the requester gets a Signal() with this bit, it will abort *)
  87.    rfu1   *  : INTEGER;
  88. END;
  89.  
  90. (* NOTE:
  91.     The  control  values  mentioned above are used if you choose to insert
  92. printf  style directives in your strings and should contain the address of
  93. a list of control parameters, usually on the stack.
  94.     *)
  95.  
  96. (*          Remember,   if  you  don't  want  to  go  through  the  hassle  of *)
  97. (*  initializing a ExtendedColorRequester structure, you can always just call  *)
  98. (*  ColorRequester  (as opposed to ExtendedColorRequester).  ColorRequester    *)
  99. (*  just  takes  a  single  parameter, in D0, the color that should start out  *)
  100. (*  being highlit.  It returns a single value, the color that was selected at  *)
  101. (*  the end. *)
  102.  
  103. (*          This structure is for use with the ExtendedColorRequester (_not_,  *)
  104. (*  the ColorRequester) function. *)
  105.  
  106. TYPE ExtendedColorRequesterPtr * = POINTER TO ExtendedColorRequester;
  107.  
  108. TYPE ExtendedColorRequester * = STRUCT
  109.    defColor     *  : LONGINT;     (* The color that is initially highlit.    *)
  110.    window       *  : I.WindowPtr; (* The window the 'requester' opens up in. *)
  111.    rfu1         *  : LONGINT;     (* Who knows what these will be used for,  *)
  112.    rfu2         *  : LONGINT;     (* but I'm sure we'll think of something.  *)
  113.    rfu3         *  : LONGINT;     (* Until then, just keep these zeroed.     *)
  114.    rfu4         *  : LONGINT;     (* Okay? *)
  115.    rfu5         *  : LONGINT;
  116. END;
  117.  
  118. (*          This structure is for use with the GetLong function. *)
  119.  
  120. CONST glNoDefault * = 0;(* Set this bit in the flags if you don't want a default*)
  121.                         (* value to show up in the get long string gadget.  For *)
  122.                         (* some things this is much better than having a zero   *)
  123.                         (* show up. *)
  124.  
  125. TYPE GetLongStructPtr * = POINTER TO GetLongStruct;
  126.  
  127. TYPE GetLongStruct * = STRUCT
  128.    titleBar     *  : E.ADDRESS;
  129.    defaultVal   *  : LONGINT;
  130.    minLimit     *  : LONGINT;
  131.    maxLimit     *  : LONGINT;
  132.    result       *  : LONGINT;
  133.    window       *  : I.WindowPtr;
  134.    versionNumber*  : INTEGER; (*  Make SURE this is set to reqVersion. *)
  135.    flags        *  : LONGSET; (*  Some, uh flags.  See above for bit definitions. *)
  136.    rfu2         *  : LONGINT; (*  Make SURE you leave these two zeroed also. *)
  137. END;
  138.  
  139. TYPE GetStringStructPtr * = POINTER TO GetStringStruct;
  140.  
  141. TYPE GetStringStruct * = STRUCT
  142.    titleBar     *  : E.ADDRESS;
  143.    stringBuffer *  : E.ADDRESS;
  144.    window       *  : I.WindowPtr;
  145.    stringSize   *  : INTEGER; (* how many characters in the buffer  *)
  146.    visibleSize  *  : INTEGER; (* how many characters show on screen *)
  147.    versionNumber*  : INTEGER;
  148.    flags    *   : LONGSET;
  149.    rfu1     *   : LONGINT;
  150.    rfu2     *   : LONGINT;
  151.    rfu3     *   : LONGINT;
  152. END;
  153.  
  154. CONST dsize      * = 130;
  155.       fchars     * =  30;
  156.       wildLength * =  30;
  157.  
  158. TYPE DirString      * = ARRAY dsize+1 OF CHAR;
  159.      DirStringPtr   * = POINTER TO DirString;
  160.      FileString     * = ARRAY fchars+1 OF CHAR;
  161.      FileStringPtr  * = POINTER TO FileString;
  162.      PathString     * = ARRAY dsize+fchars+2 OF CHAR;
  163.      PathStringPtr  * = POINTER TO PathString;
  164.      ShowHideString * = ARRAY wildLength + 2 OF CHAR;
  165.  
  166. (*
  167.    These  are  the  bit  numbers  of various bits that you can set in the
  168. Flags  field of the file requester structure.  The actual values that come
  169. out of these bit numbers are defined in the set of includes below with the
  170. same  names  but  with  an  M  (for  mask) ending instead of a B (for bit)
  171. ending.
  172.    *)
  173.  
  174. CONST
  175.      showInfo   * = 0;  (* Set this in Flags if you want .info files to show.  They default to hidden. *)
  176.      extSelect  * = 1;  (* Set this in Flags if you want extended select.  Default is not. *)
  177.      caching    * = 2;  (* Set this in Flags if you want directory caching.  Default is not. *)
  178.      getFonts   * = 3;  (* Set this in Flags if you want a font requester rather than a file requester. *)
  179.      infoGadget * = 4;  (* Set this in Flags if you want a hide-info files gadget. *)
  180.      hideWilds  * = 5;  (* Set this in Flags if you DON'T want 'show' and 'hide' string gadgets. *)
  181.      absoluteXY * = 6;  (* Use absolute x,y positions rather than centering on mouse. *)
  182.      cachePurge * = 7;  (* Purge the cache whenever the directory date stamp changes if this is set. *)
  183.      noHalfCache* = 8;  (* Don't cache a directory unless it is completely read in when this is set. *)
  184.      noSort     * = 9;  (* Set this in Flags if you DON'T want sorted directories. *)
  185.      noDrag     * = 10; (* Set this in Flags if you DON'T want a drag bar and depth gadgets. *)
  186.      saving     * = 11; (* Set this bit if you are selecting a file to save to. *)
  187.      loading    * = 12; (* Set this bit if you are selecting a file(s) to load from. *)
  188.                         (* These two bits (save and load) aren't currently used for*)
  189.                         (* anything, but they may be in the future, so you should*)
  190.                         (* remember to set them.  Also, these bits make it easier if*)
  191.                         (* somebody wants to customize the file requester for their*)
  192.                         (* machine.  They can make it behave differently for loading*)
  193.                         (* vs saving. *)
  194.      dirOnly    * = 13; (* Allow the user to select a directory, rather than a file. *)
  195.  
  196. TYPE ESStructurePtr  * = POINTER TO ESStructure;
  197.  
  198. TYPE ESStructure * = STRUCT
  199.    nextFile     *  : ESStructurePtr;
  200.    nameLength   *  : INTEGER; (* Length of the filename field, not including the terminating zero. *)
  201.    pad          *  : INTEGER;
  202.    node         *  : E.ADDRESS;     (* For internal use only. *)
  203.    theFileName  *  : CHAR; (* This is a variable size field. *)
  204. END;
  205.  
  206. TYPE FileRequesterPtr *  = POINTER TO FileRequester;
  207.  
  208. TYPE FileRequester * = STRUCT
  209.    versionNumber  *  : INTEGER;  (* Make sure this is set to ReqVersion *)
  210.    title        *  : E.ADDRESS;  (* Hailing text *)
  211.    dir          *  : DirStringPtr;  (* Directory array (DSIZE+1) *)
  212.    file         *  : FileStringPtr;  (* Filename array (FCHARS+1) *)
  213.    pathName     *  : PathStringPtr;  (* Complete path name array (DSIZE+FCHARS+2) *)
  214.    window       *  : I.WindowPtr;   (* Window requesting or NULL *)
  215.  
  216.    maxExtendedSelect *  : INTEGER;  (* Zero implies a maximum of 65535, as long as FRQEXTSELECT is set. *)
  217.    numLines          *  : INTEGER;  (* Number of lines in file window. *)
  218.    numColumns        *  : INTEGER;  (* Number of columns in file window. *)
  219.    devColumns        *  : INTEGER;
  220.    flags             *  : LONGSET;  (* Various - umm - flags.  See above for more info. *)
  221.    dirNamesColor     *  : INTEGER;  (* These five colors will all default *)
  222.    fileNamesColor    *  : INTEGER;  (* to color one if you don't specify *)
  223.    deviceNamesColor  *  : INTEGER;  (* a color (ie; if you specify color zero). *)
  224.    fontNamesColor    *  : INTEGER;  (* If you want color zero to be used, specify *)
  225.    fontSizesColor    *  : INTEGER;  (* color 32, or some other too large number *)
  226.                                     (* which mods down to zero. *)
  227.    detailColor       *  : INTEGER;  (* If both of these colors are specified as *)
  228.    blockColor        *  : INTEGER;  (* zero then the block pen will be set to one. *)
  229.  
  230.    gadgetTextColor     *  : INTEGER;   (* The color for the text of the five boolean gadgets.  Defaults to 1. *)
  231.    textMessageColor    *  : INTEGER;   (* The color for the message at the screen top.  Defaults to 1. *)
  232.    stringNameColor     *  : INTEGER;   (* The color for the words Drawer, File, Hide and Show.  Defaults to 3. *)
  233.    stringGadgetColor   *  : INTEGER;   (* The color for the borders of the string gadgets.  Defaults to 3. *)
  234.                                        (* Unfortunately it is not possible to specify *)
  235.                                        (* the color of the actual text in an Intuition *)
  236.                                        (* string gadget. *)
  237.    boxBorderColor      *  : INTEGER;   (* The color for the boxes around the file and directory areas.  Defaults to 3. *)
  238.    gadgetBoxColor      *  : INTEGER;   (* The color for the boxes around the five boolean gadgets.  Defaults to 3. *)
  239.  
  240.    stuff               *  : ARRAY 18 OF INTEGER; (* This area, which is reserved for *)
  241.                                                  (* future use, should all be zero. *)
  242.  
  243.    dirDateStamp        *  : Dos.Date; (* A copy of the cached directories date stamp. *)
  244.                                       (* There should never be any need to change this. *)
  245.  
  246.    windowLeftEdge      *  : INTEGER;  (* These two fields are only used when the *)
  247.    windowTopEdge       *  : INTEGER;  (* FRQABSOLUTEXY flag is set.  They specify *)
  248.                                       (* the location of the upper left hand *)
  249.                                       (* corner of the window. *)
  250.  
  251.    fontYSize        *  : INTEGER;     (* These fields are used to return the selected *)
  252.    fontStyle        *  : INTEGER;     (* font size and style, only applicable when the *)
  253.                                       (* font bit is set. *)
  254.  
  255.    (*If you set the extended select bit and the user extended selects, the list of filenames will start from here. *)
  256.    extendedSelect       *  : ESStructurePtr;
  257.    hide                 *  : ShowHideString; (* The wildcards text.  *)
  258.    show                 *  : ShowHideString; (* More wildcards text. *)
  259.    fileBufferPos        *  : INTEGER; (* Various fields taken from the various *)
  260.    fileDispPos          *  : INTEGER; (* string gadgets so that the cursor *)
  261.    dirBufferPos         *  : INTEGER; (* can be returned to the same position *)
  262.    dirDispPos           *  : INTEGER; (* on subsequent calls. *)
  263.    hideBufferPos        *  : INTEGER;
  264.    hideDispPos          *  : INTEGER;
  265.    showBufferPos        *  : INTEGER;
  266.    showDispPos          *  : INTEGER;
  267.  
  268. (*      The  following  fields are PRIVATE!  Don't go messing with them or
  269.   wierd  things may/will happen.  If this isn't enough of a warning, go read
  270.   the one in intuition.h, that should scare you off.   *)
  271.  
  272.    memory  : E.ADDRESS;    (* Memory allocate for dir entries.    *)
  273.    memory2 : E.ADDRESS;    (* More memory, used for hidden files. *)
  274.    lock    : E.ADDRESS;
  275.    privateDirBuffer : ARRAY dsize+2 OF CHAR; (* Used for keeping a record of which *)
  276.                                              (* directory we have file names for. *)
  277.    fileInfoBlock : Dos.FileInfoBlock;
  278.    numEntries        : INTEGER;
  279.    numHiddenEntries  : INTEGER;
  280.    fileStartNumber   : INTEGER;
  281.    deviceStartNumber : INTEGER;
  282. END;
  283.  
  284. (*        This is used with the RealTimeScroll function. *)
  285.  
  286. TYPE ScrollStructPtr * = POINTER TO ScrollStruct;
  287.  
  288. TYPE ScrollStruct * = STRUCT
  289.    topEntryNumber *  : LONGINT; (* This is the ordinal number of the first*)
  290.                                 (* displayed entry. *)
  291.    numEntries     *  : LONGINT; (* This is the total number of entries in*)
  292.                                 (* the list. *)
  293.    lineSpacing    *  : INTEGER; (* This is how many pixels high each entry is. *)
  294.    numLines       *  : LONGINT; (* This is how many entries can be displayed simultaneously. *)
  295.    propGadget     *  : I.Gadget;(* This is a pointer to the prop gadget being monitored. *)
  296.  
  297.    RedrawAll * : PROCEDURE(); (* This routine is used to redraw all of the*)
  298.                               (* entries when the user moves far enough*)
  299.                               (* that scrolling will take too long. *)
  300.  
  301.    ReadMore  * : PROCEDURE(); (* An optional routine that is called when*)
  302.                               (* the scroll routine is waiting for movement. *)
  303.                               (* This allows reading of new data while real*)
  304.                               (* time scrolling. *)
  305.    ScrollAndDraw *  : PROCEDURE(entry{0},offset{1},amount{2},number{3}:LONGINT;scrollstruct{8}:E.ADDRESS);
  306.                               (* This routine is called when the data needs*)
  307.                               (* to be scrolled and updated.  This routine is*)
  308.                               (* passed four long parameters (on the stack and*)
  309.                               (* in D0-D3) which are, respectively:*)
  310.                               (* D0 - entry number of first line to be drawn. *)
  311.                               (* D1 - pixel offset to draw first line at. *)
  312.                               (* D2 - amount to scroll before doing any drawing. *)
  313.                               (* D3 - number of lines of data to draw. *)
  314.    versionNumber * : INTEGER; (* Make SURE this is set to reqVersion *)
  315.    rfu1     *  : LONGINT;     (* Make SURE you leave these two zeroed also. *)
  316.    rfu2     *  : LONGINT;     (* Make SURE you leave these two zeroed also. *)
  317. END;
  318.  
  319. TYPE ChipstuffPtr *  = POINTER TO Chipstuff;
  320.  
  321. TYPE Chipstuff * = STRUCT
  322.    arrowUp    *  : ARRAY 10 OF INTEGER; (* 16 pixels wide, 10 pixels high. *)
  323.    arrowDown  *  : ARRAY 10 OF INTEGER; (* 16 pixels wide, 10 pixels high. *)
  324.    arrowLeft  *  : ARRAY  9 OF INTEGER; (* 16 pixels wide, 9 pixels high.  *)
  325.    arrowRight *  : ARRAY  9 OF INTEGER; (* 16 pixels wide, 9 pixels high.  *)
  326.    letterR    *  : ARRAY 10 OF INTEGER; (* 16 pixels wide, 10 pixels high. *)
  327.    letterG    *  : ARRAY 10 OF INTEGER; (* 16 pixels wide, 10 pixels high. *)
  328.    letterB    *  : ARRAY 10 OF INTEGER; (* 16 pixels wide, 10 pixels high. *)
  329.    letterH    *  : ARRAY 10 OF INTEGER; (* 16 pixels wide, 10 pixels high. *)
  330.    letterS    *  : ARRAY 10 OF INTEGER; (* 16 pixels wide, 10 pixels high. *)
  331.    letterV    *  : ARRAY 10 OF INTEGER; (* 16 pixels wide, 10 pixels high. *)
  332. END;
  333.  
  334. TYPE ReqLibPtr *  = POINTER TO  ReqLib;
  335.  
  336. TYPE ReqLib * = STRUCT
  337.    rLib          *  : E.LibraryPtr;
  338.    sysLib        *  : E.ExecBasePtr;
  339.    dosLib        *  : Dos.DosLibraryPtr;
  340.    intuiLib      *  : I.IntuitionBasePtr;
  341.    gfxLib        *  : G.GfxBasePtr;
  342.    segList       *  : E.BPTR;
  343.    images        *  : ChipstuffPtr;
  344.    flags         *  : SET;
  345.    pad           *  : SET;
  346.    consoleDev    *  : E.DevicePtr;
  347.    consoleHandle *  : E.IOStdReqPtr;
  348.    rexxSysBase   *  : E.LibraryPtr;
  349. END;
  350.  
  351. VAR   req * : ReqLibPtr;
  352.  
  353. PROCEDURE Center* {req,-30}(VAR nw{8}:I.NewWindow;x{0},y{1}:INTEGER);
  354.  
  355. PROCEDURE SetSize* {req,-36}(maxValue{0},viewSize{1}:LONGINT): INTEGER;
  356.  
  357. PROCEDURE SetLocation* {req,-42}(maxValue{0},viewSize{1},value{2}:LONGINT): INTEGER;
  358.  
  359. PROCEDURE ReadLocation* {req,-48}(maxValue{0},viewSize{1}:LONGINT;potValue{2}:INTEGER): LONGINT;
  360.  
  361. PROCEDURE Format* {req,-54}(buffer{10},string{8}: ARRAY OF CHAR; values{9}:E.ADDRESS):LONGINT;
  362.  
  363. PROCEDURE FileRequest* {req,-84}(filereq{8} :FileRequesterPtr): BOOLEAN;
  364.  
  365. PROCEDURE ColorRequester* {req,-90}(desiredColor{0}:LONGINT): LONGINT;
  366.  
  367. PROCEDURE DrawBox* {req,-96}(rp{9}: G.RastPortPtr;minX{0},minY{1},maxX{2},maxY{3}:LONGINT);
  368.  
  369. PROCEDURE MakeButton* {req,-102}(buffer{8}:TwoImageGadgetPtr;image{9},image2{10}:E.ADDRESS;width{0},heigth{1},depth{2}:LONGINT);
  370.  
  371. PROCEDURE MakeScrollBar* {req,-108}(buffer{8}:ScrollBlockPtr;flags{0}:LONGSET;size{1},x{2},y{3}:LONGINT);
  372.  
  373. PROCEDURE PurgeFiles* {req,-114}(filereq{8}:FileRequesterPtr);
  374.  
  375. PROCEDURE MakeGadget* {req,-126}(buffer{8}:GadgetBlockPtr;string{9}: ARRAY OF CHAR;x{0},y{1}:LONGINT);
  376.  
  377. PROCEDURE MakeString* {req,-132}(buffer{8}:StringBlockPtr;stringbuff{9},undobuff{10}:ARRAY OF CHAR;maxwidthbits{0},maxnumchars{1},x{2},y{3}:LONGINT);
  378.  
  379. PROCEDURE MakeProp* {req,-138}(buffer{8}:PropBlockPtr;width{0},height{1}:LONGINT;flags{2}:LONGSET);
  380.  
  381. PROCEDURE LinkGadget* {req,-144}(buffer{8}:GadgetBlockPtr;string{9}: ARRAY OF CHAR;VAR nw{11}:I.NewWindow;x{0},y{1}:LONGINT);
  382.  
  383. PROCEDURE LinkStringGadget* {req,-150}(buffer{8}:StringBlockPtr;stringbuff{9},undobuff{10}:ARRAY OF CHAR;VAR nw{11}:I.NewWindow;widthbits{0},
  384.                            numchars{1},x{2},y{3}:LONGINT);
  385. PROCEDURE LinkPropGadget* {req,-156}(buffer{8}:PropBlockPtr;VAR nw{11}:I.NewWindow;width{0},height{1}:LONGINT;flags{2}:LONGSET;leftEdge{3},topEdge{4}:LONGINT);
  386.  
  387. PROCEDURE GetString* {req,-162}(buffer{8}:ARRAY OF CHAR;title{9}:ARRAY OF CHAR;window{10}:I.WindowPtr;visiblechars{0},maxchars{1}:LONGINT):BOOLEAN;
  388.  
  389. PROCEDURE RealTimeScroll* {req,-168}(scrollstruct{8}:ScrollStructPtr);
  390.  
  391. PROCEDURE TextRequest* {req,-174}(trs{8}:TRStructurePtr):INTEGER;
  392.  
  393. PROCEDURE GetLong* {req,-180}(gl{8}:GetLongStructPtr):BOOLEAN;
  394.  
  395. PROCEDURE RawKeyToAscii* {req,-186}(code{0},qualifier{1}:INTEGER;iaddress{8}:E.ADDRESS):CHAR;
  396.  
  397. PROCEDURE ExtendedColorRequest* {req,-192}(extcolreq{8}:ExtendedColorRequesterPtr):LONGINT;
  398.  
  399. PROCEDURE NewGetString* {req,-198}(ngetstr{8}:GetStringStructPtr):BOOLEAN;
  400.  
  401. PROCEDURE SimpleRequest* (string:ARRAY OF CHAR;parameterlist:E.ADDRESS);
  402.  
  403. VAR textRPtr:TRStructurePtr;
  404.  
  405. BEGIN
  406.  
  407.    NEW(textRPtr);
  408.    textRPtr.text := SYSTEM.ADR(string);
  409.    textRPtr.controls := parameterlist;
  410.    textRPtr.window := NIL;
  411.    textRPtr.middleText := NIL;
  412.    textRPtr.positiveText := NIL;
  413.    textRPtr.negativeText := SYSTEM.ADR("Resume");
  414.    textRPtr.title := SYSTEM.ADR("okay?");
  415.    textRPtr.keyMask := {0..15};
  416.    textRPtr.textColor := 1;
  417.    textRPtr.detailColor := 0;
  418.    textRPtr.blockColor := 0;
  419.    textRPtr.versionNumber := Version;
  420.    textRPtr.rfu1 := 0;
  421.    IF TextRequest(textRPtr)=0 THEN END;
  422.    DISPOSE(textRPtr);
  423.    
  424. END SimpleRequest;
  425.  
  426. PROCEDURE TwoGadRequest* (string:ARRAY OF CHAR;parameterlist:E.ADDRESS):INTEGER;
  427.  
  428. VAR textRPtr:TRStructurePtr;
  429.     result:INTEGER; 
  430. BEGIN
  431.  
  432.    NEW(textRPtr);
  433.    textRPtr.text := SYSTEM.ADR(string);
  434.    textRPtr.controls := parameterlist;
  435.    textRPtr.window := NIL;
  436.    textRPtr.middleText := NIL;
  437.    textRPtr.positiveText := SYSTEM.ADR("  Ok  ");
  438.    textRPtr.negativeText := SYSTEM.ADR("Cancel");
  439.    textRPtr.title := SYSTEM.ADR("okay?");
  440.    textRPtr.keyMask := {0..15};
  441.    textRPtr.textColor := 1;
  442.    textRPtr.detailColor := 0;
  443.    textRPtr.blockColor := 0;
  444.    textRPtr.versionNumber := Version;
  445.    textRPtr.rfu1 := 0;
  446.    result := TextRequest(textRPtr);
  447.    DISPOSE(textRPtr);
  448.    RETURN result;
  449.    
  450. END TwoGadRequest;
  451.  
  452. (* $OvflChk- $RangeChk- $StackChk- $NilChk- $ReturnChk- $CaseChk- *)
  453.  
  454. BEGIN
  455.  
  456.  req :=  SYSTEM.VAL(ReqLibPtr,E.OpenLibrary(Name,Version));
  457.  IF req = NIL THEN
  458.    SYSTEM.SETREG(0,I.DisplayAlert(0,"\x00\x84\x14Missing req.library\o\o",50));
  459.    HALT(0);
  460.  END;
  461.  
  462. CLOSE
  463.  
  464.  IF req#NIL THEN E.CloseLibrary(SYSTEM.VAL(E.LibraryPtr,req)) END;
  465.  
  466. END Req.
  467.